const util = require('../../../../utils/util.js')
import { getInfo as memberInfo } from '../../../../api/shareCenter'
const app = getApp()
Page({
    data: {
        balance:'0',
        dialogShow: false,
        memberInfo: {},
        showOneButtonDialog: false,
        wharehouseBalance:app.globalData.wharehouseBalance,
        vipType:0,
    },
    toTransfer(){
        wx.navigateTo({
            url: '/pages/member/warehouse/transfer'
        })
    },
    toRecharege() {
        wx.navigateTo({
            url: '/pages/member/warehouse/recharge'
        })
    },
    onLoad: function (options) {
        this.data.vipType = options.vipType
        this.setData({
            vipType:this.data.vipType
        })
        this.loadPromoter()
    },
    loadPromoter() {
        memberInfo().then(res => {
          this.data.balance = res.data.balance
          this.setData({
            balance: this.data.balance,
            wharehouseBalance:true
          })
        })
      },
    onReady: function () {

    },
    onShow: function () {

        this.loadPromoter()
    },
    onHide: function () {

    },
    toList(){
        wx.navigateTo({
            url: '/pages/member/warehouse/details',
        })
    },
})
